package com.ruoyi.qsng.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qsng.domain.TStudent;
import com.ruoyi.qsng.mapper.TStudentMapper;
import com.ruoyi.qsng.service.ITStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 学生信息Service业务层处理
 * 
 * @author gk
 * @date 2023-08-15
 */
@Service
public class TStudentServiceImpl implements ITStudentService
{
    @Autowired
    private TStudentMapper tStudentMapper;

    @Override
    public TStudent selectTStudentByIdCard(String idCard) {
        return tStudentMapper.selectTStudentByIdCard(idCard);
    }

    /**
     * 查询学生信息
     * 
     * @param id 学生信息主键
     * @return 学生信息
     */
    @Override
    public TStudent selectTStudentById(Long id)
    {
        return tStudentMapper.selectTStudentById(id);
    }

    /**
     * 查询学生信息列表
     * 
     * @param tStudent 学生信息
     * @return 学生信息
     */
    @Override
    public List<TStudent> selectTStudentList(TStudent tStudent)
    {
        return tStudentMapper.selectTStudentList(tStudent);
    }

    /**
     * 新增学生信息
     * 
     * @param tStudent 学生信息
     * @return 结果
     */
    @Override
    public int insertTStudent(TStudent tStudent)
    {
        tStudent.setCreateTime(DateUtils.getNowDate());
        return tStudentMapper.insertTStudent(tStudent);
    }

    /**
     * 修改学生信息
     * 
     * @param tStudent 学生信息
     * @return 结果
     */
    @Override
    public int updateTStudent(TStudent tStudent)
    {
        tStudent.setUpdateTime(DateUtils.getNowDate());
        return tStudentMapper.updateTStudent(tStudent);
    }

    /**
     * 批量删除学生信息
     * 
     * @param ids 需要删除的学生信息主键
     * @return 结果
     */
    @Override
    public int deleteTStudentByIds(Long[] ids)
    {
        return tStudentMapper.deleteTStudentByIds(ids);
    }

    /**
     * 删除学生信息信息
     * 
     * @param id 学生信息主键
     * @return 结果
     */
    @Override
    public int deleteTStudentById(Long id)
    {
        return tStudentMapper.deleteTStudentById(id);
    }
}
